package net.awpspace.mobile.management.contact;

import javax.microedition.midlet.MIDlet;

import com.sun.lwuit.Button;
import com.sun.lwuit.Command;
import com.sun.lwuit.Container;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.layouts.BoxLayout;

import net.awpspace.mobile.form.BaseForm;

public class ContactManagement extends BaseForm{

	public ContactManagement(MIDlet app, BaseForm parent) {
		super(app, parent);
		setTitle("Thêm liên lạc");
		Container container = new Container(new BoxLayout(BoxLayout.Y_AXIS));
		Button addContact = new Button(new Command("Thêm liên lạc"));
		Button viewContact = new Button(new Command("Xem liên lạc"));
		Button editContact = new Button(new Command("Sửa liên lạc"));
		Button deleteContact = new Button(new Command("Xóa liên lạc"));
		Button viewContactfull = new Button(new Command("Xem danh bạ"));

		container.addComponent(addContact);
		container.addComponent(viewContact);
		container.addComponent(editContact);
		container.addComponent(deleteContact);
		container.addComponent(viewContactfull);

		this.addComponent(container);
		// TODO Auto-generated constructor stub
	}

	protected void processCommand(ActionEvent e) {
		if(e.getCommand().getCommandName().equals("Thêm liên lạc")){
			new AddContact(app,this).show();
			
			
		}
		if(e.getCommand().getCommandName().equals("Xem liên lạc")){
			new ViewContact(app, this).show();
			
		}
		if(e.getCommand().getCommandName().equals("Sửa liên lạc")){
			new EditContact(app, this).show();
		
		}
		if(e.getCommand().getCommandName().equals("Xóa liên lạc")){
			new DeleteContact(app, this).show();
		}
		if(e.getCommand().getCommandName().equals("Xem danh bạ")){
			new ViewfullContact(app,this).show();
			
			
		}
		// TODO Auto-generated method stub
		
		
	}
	
	
}
